package aybolit.core.objects.model;
// Generated 27.02.2013 9:15:35 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Operators generated by hbm2java
 */
@Entity
@Table(name="operators"
    ,catalog="aybolit"
)
public class Operators  implements java.io.Serializable {


     private Integer operId;
     private OperStatuses operStatuses;
     private Hospitales hospitales;
     private Departments departments;
     private OperTypes operTypes;
     private String login;
     private String password;
     private Set<Patientes> patienteses = new HashSet<Patientes>(0);

    public Operators() {
    }

	
    public Operators(OperStatuses operStatuses, Hospitales hospitales, OperTypes operTypes, String login, String password) {
        this.operStatuses = operStatuses;
        this.hospitales = hospitales;
        this.operTypes = operTypes;
        this.login = login;
        this.password = password;
    }
    public Operators(OperStatuses operStatuses, Hospitales hospitales, Departments departments, OperTypes operTypes, String login, String password, Set<Patientes> patienteses) {
       this.operStatuses = operStatuses;
       this.hospitales = hospitales;
       this.departments = departments;
       this.operTypes = operTypes;
       this.login = login;
       this.password = password;
       this.patienteses = patienteses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="oper_id", unique=true, nullable=false)
    public Integer getOperId() {
        return this.operId;
    }
    
    public void setOperId(Integer operId) {
        this.operId = operId;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="oper_status_id", nullable=false)
    public OperStatuses getOperStatuses() {
        return this.operStatuses;
    }
    
    public void setOperStatuses(OperStatuses operStatuses) {
        this.operStatuses = operStatuses;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="hospital_id", nullable=false)
    public Hospitales getHospitales() {
        return this.hospitales;
    }
    
    public void setHospitales(Hospitales hospitales) {
        this.hospitales = hospitales;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="department_id")
    public Departments getDepartments() {
        return this.departments;
    }
    
    public void setDepartments(Departments departments) {
        this.departments = departments;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="oper_type_id", nullable=false)
    public OperTypes getOperTypes() {
        return this.operTypes;
    }
    
    public void setOperTypes(OperTypes operTypes) {
        this.operTypes = operTypes;
    }
    
    @Column(name="login", nullable=false, length=200)
    public String getLogin() {
        return this.login;
    }
    
    public void setLogin(String login) {
        this.login = login;
    }
    
    @Column(name="password", nullable=false, length=200)
    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="operators")
    public Set<Patientes> getPatienteses() {
        return this.patienteses;
    }
    
    public void setPatienteses(Set<Patientes> patienteses) {
        this.patienteses = patienteses;
    }




}


